package com.toKnow.mapper;

import com.toKnow.model.dto.SearchDto;
import com.toKnow.model.entity.*;

import java.util.List;

public interface ArticleMapper {
    public Article selectById(Integer id);
    public Boolean updateLikeNumber(Integer id,Integer num);
    public Boolean updateCollectNumber(Integer id,Integer num);
    public Boolean updateReadNumber(Integer id,Integer num);
    public Boolean insertUserLike(Integer userId,Integer articleId);
    public Boolean insertUserCollect(Integer userId,Integer articleId);
    public Boolean insertUserRead(Integer userId,Integer articleId);
    public Boolean deleteUserLike(Integer userId,Integer articleId);
    public Boolean deleteUserCollect(Integer userId,Integer articleId);
    public Boolean deleteUserRead(Integer userId,Integer articleId);
    public Boolean checkUserLike(Integer userId,Integer articleId);
    public Boolean checkUserCollect(Integer userId,Integer articleId);
    public Boolean checkUserRead(Integer userId,Integer articleId);
    public Boolean updateUserRead(Integer userId,Integer articleId);
    public List<Type> selectTypeById(Integer articleId);
    public List<Tag> selectTagById(Integer articleId);
    public List<Type> selectDraftTypeById(Integer articleId);
    public List<Tag> selectDraftTagById(Integer articleId);
    public List<Article> selectArticleByColumnId(Integer columnId,Integer startRow);
    public List<Article> selectArticleBySearch(SearchDto searchDto);
    public List<Article> selectArticleByCollect(Integer userId,Integer startRow);
    public List<Article> selectArticleByAuthor(Integer userId,Integer startRow);
    public List<Article> selectArticleByBrowseHistory(Integer userId,Integer startRow);
    public List<ArticleComment> selectArticleCommentByArticleId(Integer articleId,Integer startRow);
    public List<ArticleAnswer> selectArticleAnswerByCommentId(Integer commentId,Integer startRow);

    public List<Article> getDraftArticle(Integer uid);
    public List<Article> getCheckingArticle(Integer uid);
    public Article selectArticleDraftById(Integer uid, Integer aid);
}
